import random

# 显示界面
print("这是一个猜拳小游戏：1代表石头，2代表剪刀，3代表布")
while True:
    # 玩家出拳
    player = int(input("请输入您的出拳："))
    # 添加退出游戏的条件
    if player not in range(1, 4):
        break
    # 电脑出拳
    computer = random.randint(1, 3)
    # 判断输赢
    if (player == 1 and computer == 2) or (player == 2 and computer == 3) or (player == 3 and computer == 1):
        print("恭喜您赢了！！！")
    elif player == computer:
        print("平局！！！")
    else:
        print("对不起您输了！！！")
    # 字符串*数值相当于对字符串复制数值的倍数
    print("*" * 300)
